3.993 \(\int \frac{(A+B \cos (c+d x)+C \cos ^2(c+d x)) \sec ^4(c+d x)}{(a+b \cos (c+d x))^2} \, dx\)

Optimal. Leaf size=405 \[ \frac{2 b^2 \left (5 a^2 A b^2-2 a^2 b^2 C-4 a^3 b B+3 a^4 C+3 a b^3 B-4 A b^4\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^5 d (a-b)^{3/2} (a+b)^{3/2}}-\frac{\tan (c+d x) \left (-a^2 b^2 (7 A-6 C)+a^4 (-(2 A+3 C))+6 a^3 b B-9 a b^3 B+12 A b^4\right )}{3 a^4 d \left (a^2-b^2\right )}-\frac{\left (2 a^2 b (A+2 C)+a^3 (-B)-6 a b^2 B+8 A b^3\right ) \tanh ^{-1}(\sin (c+d x))}{2 a^5 d}-\frac{\tan (c+d x) \sec ^2(c+d x) \left (a^2 (-(A-3 C))-3 a b B+4 A b^2\right )}{3 a^2 d \left (a^2-b^2\right )}+\frac{\tan (c+d x) \sec (c+d x) \left (-2 a^2 b (A-C)+a^3 B-3 a b^2 B+4 A b^3\right )}{2 a^3 d \left (a^2-b^2\right )}+\frac{\tan (c+d x) \sec ^2(c+d x) \left (A b^2-a (b B-a C)\right )}{a d \left (a^2-b^2\right ) (a+b \cos (c+d x))} \]

[Out]

(2*b^2*(5*a^2*A*b^2 - 4*A*b^4 - 4*a^3*b*B + 3*a*b^3*B + 3*a^4*C - 2*a^2*b^2*C)*ArcTan[(Sqrt[a - b]*Tan[(c + d*
x)/2])/Sqrt[a + b]])/(a^5*(a - b)^(3/2)*(a + b)^(3/2)*d) - ((8*A*b^3 - a^3*B - 6*a*b^2*B + 2*a^2*b*(A + 2*C))*
ArcTanh[Sin[c + d*x]])/(2*a^5*d) - ((12*A*b^4 + 6*a^3*b*B - 9*a*b^3*B - a^2*b^2*(7*A - 6*C) - a^4*(2*A + 3*C))
*Tan[c + d*x])/(3*a^4*(a^2 - b^2)*d) + ((4*A*b^3 + a^3*B - 3*a*b^2*B - 2*a^2*b*(A - C))*Sec[c + d*x]*Tan[c + d
*x])/(2*a^3*(a^2 - b^2)*d) - ((4*A*b^2 - 3*a*b*B - a^2*(A - 3*C))*Sec[c + d*x]^2*Tan[c + d*x])/(3*a^2*(a^2 - b
^2)*d) + ((A*b^2 - a*(b*B - a*C))*Sec[c + d*x]^2*Tan[c + d*x])/(a*(a^2 - b^2)*d*(a + b*Cos[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 2.00368, antiderivative size = 405, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 5, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.122, Rules used = {3055, 3001, 3770, 2659, 205} \[ \frac{2 b^2 \left (5 a^2 A b^2-2 a^2 b^2 C-4 a^3 b B+3 a^4 C+3 a b^3 B-4 A b^4\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^5 d (a-b)^{3/2} (a+b)^{3/2}}-\frac{\tan (c+d x) \left (-a^2 b^2 (7 A-6 C)+a^4 (-(2 A+3 C))+6 a^3 b B-9 a b^3 B+12 A b^4\right )}{3 a^4 d \left (a^2-b^2\right )}-\frac{\left (2 a^2 b (A+2 C)+a^3 (-B)-6 a b^2 B+8 A b^3\right ) \tanh ^{-1}(\sin (c+d x))}{2 a^5 d}-\frac{\tan (c+d x) \sec ^2(c+d x) \left (a^2 (-(A-3 C))-3 a b B+4 A b^2\right )}{3 a^2 d \left (a^2-b^2\right )}+\frac{\tan (c+d x) \sec (c+d x) \left (-2 a^2 b (A-C)+a^3 B-3 a b^2 B+4 A b^3\right )}{2 a^3 d \left (a^2-b^2\right )}+\frac{\tan (c+d x) \sec ^2(c+d x) \left (A b^2-a (b B-a C)\right )}{a d \left (a^2-b^2\right ) (a+b \cos (c+d x))} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^4)/(a + b*Cos[c + d*x])^2,x]

[Out]

(2*b^2*(5*a^2*A*b^2 - 4*A*b^4 - 4*a^3*b*B + 3*a*b^3*B + 3*a^4*C - 2*a^2*b^2*C)*ArcTan[(Sqrt[a - b]*Tan[(c + d*
x)/2])/Sqrt[a + b]])/(a^5*(a - b)^(3/2)*(a + b)^(3/2)*d) - ((8*A*b^3 - a^3*B - 6*a*b^2*B + 2*a^2*b*(A + 2*C))*
ArcTanh[Sin[c + d*x]])/(2*a^5*d) - ((12*A*b^4 + 6*a^3*b*B - 9*a*b^3*B - a^2*b^2*(7*A - 6*C) - a^4*(2*A + 3*C))
*Tan[c + d*x])/(3*a^4*(a^2 - b^2)*d) + ((4*A*b^3 + a^3*B - 3*a*b^2*B - 2*a^2*b*(A - C))*Sec[c + d*x]*Tan[c + d
*x])/(2*a^3*(a^2 - b^2)*d) - ((4*A*b^2 - 3*a*b*B - a^2*(A - 3*C))*Sec[c + d*x]^2*Tan[c + d*x])/(3*a^2*(a^2 - b
^2)*d) + ((A*b^2 - a*(b*B - a*C))*Sec[c + d*x]^2*Tan[c + d*x])/(a*(a^2 - b^2)*d*(a + b*Cos[c + d*x]))

Rule 3055

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*s
in[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> -Simp[((A*b^2 - a*b*B + a^2*C)*Cos[e +
 f*x]*(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n + 1))/(f*(m + 1)*(b*c - a*d)*(a^2 - b^2)), x] + Dis
t[1/((m + 1)*(b*c - a*d)*(a^2 - b^2)), Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[(m + 1)*(b
*c - a*d)*(a*A - b*B + a*C) + d*(A*b^2 - a*b*B + a^2*C)*(m + n + 2) - (c*(A*b^2 - a*b*B + a^2*C) + (m + 1)*(b*
c - a*d)*(A*b - a*B + b*C))*Sin[e + f*x] - d*(A*b^2 - a*b*B + a^2*C)*(m + n + 3)*Sin[e + f*x]^2, x], x], x] /;
 FreeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && Lt
Q[m, -1] && ((EqQ[a, 0] && IntegerQ[m] &&  !IntegerQ[n]) ||  !(IntegerQ[2*n] && LtQ[n, -1] && ((IntegerQ[n] &&
  !IntegerQ[m]) || EqQ[a, 0])))

Rule 3001

Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.)
+ (f_.)*(x_)])), x_Symbol] :> Dist[(A*b - a*B)/(b*c - a*d), Int[1/(a + b*Sin[e + f*x]), x], x] + Dist[(B*c - A
*d)/(b*c - a*d), Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0]
 && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x)}{(a+b \cos (c+d x))^2} \, dx &=\frac{\left (A b^2-a (b B-a C)\right ) \sec ^2(c+d x) \tan (c+d x)}{a \left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac{\int \frac{\left (-4 A b^2+3 a b B+a^2 (A-3 C)-a (A b-a B+b C) \cos (c+d x)+3 \left (A b^2-a (b B-a C)\right ) \cos ^2(c+d x)\right ) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx}{a \left (a^2-b^2\right )}\\ &=-\frac{\left (4 A b^2-3 a b B-a^2 (A-3 C)\right ) \sec ^2(c+d x) \tan (c+d x)}{3 a^2 \left (a^2-b^2\right ) d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec ^2(c+d x) \tan (c+d x)}{a \left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac{\int \frac{\left (3 \left (4 A b^3+a^3 B-3 a b^2 B-2 a^2 b (A-C)\right )+a \left (A b^2-3 a b B+a^2 (2 A+3 C)\right ) \cos (c+d x)-2 b \left (4 A b^2-3 a b B-a^2 (A-3 C)\right ) \cos ^2(c+d x)\right ) \sec ^3(c+d x)}{a+b \cos (c+d x)} \, dx}{3 a^2 \left (a^2-b^2\right )}\\ &=\frac{\left (4 A b^3+a^3 B-3 a b^2 B-2 a^2 b (A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right ) d}-\frac{\left (4 A b^2-3 a b B-a^2 (A-3 C)\right ) \sec ^2(c+d x) \tan (c+d x)}{3 a^2 \left (a^2-b^2\right ) d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec ^2(c+d x) \tan (c+d x)}{a \left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac{\int \frac{\left (-2 \left (12 A b^4+6 a^3 b B-9 a b^3 B-a^2 b^2 (7 A-6 C)-a^4 (2 A+3 C)\right )-a \left (4 A b^3-3 a^3 B-3 a b^2 B+2 a^2 b (A+3 C)\right ) \cos (c+d x)+3 b \left (4 A b^3+a^3 B-3 a b^2 B-2 a^2 b (A-C)\right ) \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx}{6 a^3 \left (a^2-b^2\right )}\\ &=-\frac{\left (12 A b^4+6 a^3 b B-9 a b^3 B-a^2 b^2 (7 A-6 C)-a^4 (2 A+3 C)\right ) \tan (c+d x)}{3 a^4 \left (a^2-b^2\right ) d}+\frac{\left (4 A b^3+a^3 B-3 a b^2 B-2 a^2 b (A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right ) d}-\frac{\left (4 A b^2-3 a b B-a^2 (A-3 C)\right ) \sec ^2(c+d x) \tan (c+d x)}{3 a^2 \left (a^2-b^2\right ) d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec ^2(c+d x) \tan (c+d x)}{a \left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac{\int \frac{\left (-3 \left (a^2-b^2\right ) \left (8 A b^3-a^3 B-6 a b^2 B+2 a^2 b (A+2 C)\right )+3 a b \left (4 A b^3+a^3 B-3 a b^2 B-2 a^2 b (A-C)\right ) \cos (c+d x)\right ) \sec (c+d x)}{a+b \cos (c+d x)} \, dx}{6 a^4 \left (a^2-b^2\right )}\\ &=-\frac{\left (12 A b^4+6 a^3 b B-9 a b^3 B-a^2 b^2 (7 A-6 C)-a^4 (2 A+3 C)\right ) \tan (c+d x)}{3 a^4 \left (a^2-b^2\right ) d}+\frac{\left (4 A b^3+a^3 B-3 a b^2 B-2 a^2 b (A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right ) d}-\frac{\left (4 A b^2-3 a b B-a^2 (A-3 C)\right ) \sec ^2(c+d x) \tan (c+d x)}{3 a^2 \left (a^2-b^2\right ) d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec ^2(c+d x) \tan (c+d x)}{a \left (a^2-b^2\right ) d (a+b \cos (c+d x))}-\frac{\left (b^2 \left (4 A b^4+4 a^3 b B-3 a b^3 B-a^2 b^2 (5 A-2 C)-3 a^4 C\right )\right ) \int \frac{1}{a+b \cos (c+d x)} \, dx}{a^5 \left (a^2-b^2\right )}-\frac{\left (8 A b^3-a^3 B-6 a b^2 B+2 a^2 b (A+2 C)\right ) \int \sec (c+d x) \, dx}{2 a^5}\\ &=-\frac{\left (8 A b^3-a^3 B-6 a b^2 B+2 a^2 b (A+2 C)\right ) \tanh ^{-1}(\sin (c+d x))}{2 a^5 d}-\frac{\left (12 A b^4+6 a^3 b B-9 a b^3 B-a^2 b^2 (7 A-6 C)-a^4 (2 A+3 C)\right ) \tan (c+d x)}{3 a^4 \left (a^2-b^2\right ) d}+\frac{\left (4 A b^3+a^3 B-3 a b^2 B-2 a^2 b (A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right ) d}-\frac{\left (4 A b^2-3 a b B-a^2 (A-3 C)\right ) \sec ^2(c+d x) \tan (c+d x)}{3 a^2 \left (a^2-b^2\right ) d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec ^2(c+d x) \tan (c+d x)}{a \left (a^2-b^2\right ) d (a+b \cos (c+d x))}-\frac{\left (2 b^2 \left (4 A b^4+4 a^3 b B-3 a b^3 B-a^2 b^2 (5 A-2 C)-3 a^4 C\right )\right ) \operatorname{Subst}\left (\int \frac{1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{a^5 \left (a^2-b^2\right ) d}\\ &=\frac{2 b^2 \left (5 a^2 A b^2-4 A b^4-4 a^3 b B+3 a b^3 B+3 a^4 C-2 a^2 b^2 C\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^5 (a-b)^{3/2} (a+b)^{3/2} d}-\frac{\left (8 A b^3-a^3 B-6 a b^2 B+2 a^2 b (A+2 C)\right ) \tanh ^{-1}(\sin (c+d x))}{2 a^5 d}-\frac{\left (12 A b^4+6 a^3 b B-9 a b^3 B-a^2 b^2 (7 A-6 C)-a^4 (2 A+3 C)\right ) \tan (c+d x)}{3 a^4 \left (a^2-b^2\right ) d}+\frac{\left (4 A b^3+a^3 B-3 a b^2 B-2 a^2 b (A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right ) d}-\frac{\left (4 A b^2-3 a b B-a^2 (A-3 C)\right ) \sec ^2(c+d x) \tan (c+d x)}{3 a^2 \left (a^2-b^2\right ) d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec ^2(c+d x) \tan (c+d x)}{a \left (a^2-b^2\right ) d (a+b \cos (c+d x))}\\ \end{align*}

Mathematica [A]  time = 3.0485, size = 519, normalized size = 1.28 \[ \frac{-\frac{24 b^2 \left (a^2 b^2 (2 C-5 A)+4 a^3 b B-3 a^4 C-3 a b^3 B+4 A b^4\right ) \tanh ^{-1}\left (\frac{(a-b) \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{b^2-a^2}}\right )}{\left (b^2-a^2\right )^{3/2}}+6 \left (2 a^2 b (A+2 C)+a^3 (-B)-6 a b^2 B+8 A b^3\right ) \log \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )+6 \left (-2 a^2 b (A+2 C)+a^3 B+6 a b^2 B-8 A b^3\right ) \log \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )+\frac{a \tan (c+d x) \sec ^2(c+d x) \left (a \left (a^2-b^2\right ) \cos (2 (c+d x)) \left (a^2 (4 A+6 C)-9 a b B+12 A b^2\right )+\cos (c+d x) \left (a^2 b^3 (29 A-18 C)+a^4 (9 b C-2 A b)-24 a^3 b^2 B+6 a^5 B+27 a b^4 B-36 A b^5\right )+7 a^2 A b^3 \cos (3 (c+d x))+4 a^3 A b^2+2 a^4 A b \cos (3 (c+d x))+8 a^5 A-6 a^3 b^2 B \cos (3 (c+d x))+9 a^2 b^3 B-6 a^2 b^3 C \cos (3 (c+d x))-6 a^3 b^2 C-9 a^4 b B+3 a^4 b C \cos (3 (c+d x))+6 a^5 C-12 a A b^4+9 a b^4 B \cos (3 (c+d x))-12 A b^5 \cos (3 (c+d x))\right )}{\left (a^2-b^2\right ) (a+b \cos (c+d x))}}{12 a^5 d} \]

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^4)/(a + b*Cos[c + d*x])^2,x]

[Out]

((-24*b^2*(4*A*b^4 + 4*a^3*b*B - 3*a*b^3*B - 3*a^4*C + a^2*b^2*(-5*A + 2*C))*ArcTanh[((a - b)*Tan[(c + d*x)/2]
)/Sqrt[-a^2 + b^2]])/(-a^2 + b^2)^(3/2) + 6*(8*A*b^3 - a^3*B - 6*a*b^2*B + 2*a^2*b*(A + 2*C))*Log[Cos[(c + d*x
)/2] - Sin[(c + d*x)/2]] + 6*(-8*A*b^3 + a^3*B + 6*a*b^2*B - 2*a^2*b*(A + 2*C))*Log[Cos[(c + d*x)/2] + Sin[(c
+ d*x)/2]] + (a*(8*a^5*A + 4*a^3*A*b^2 - 12*a*A*b^4 - 9*a^4*b*B + 9*a^2*b^3*B + 6*a^5*C - 6*a^3*b^2*C + (-36*A
*b^5 + 6*a^5*B - 24*a^3*b^2*B + 27*a*b^4*B + a^2*b^3*(29*A - 18*C) + a^4*(-2*A*b + 9*b*C))*Cos[c + d*x] + a*(a
^2 - b^2)*(12*A*b^2 - 9*a*b*B + a^2*(4*A + 6*C))*Cos[2*(c + d*x)] + 2*a^4*A*b*Cos[3*(c + d*x)] + 7*a^2*A*b^3*C
os[3*(c + d*x)] - 12*A*b^5*Cos[3*(c + d*x)] - 6*a^3*b^2*B*Cos[3*(c + d*x)] + 9*a*b^4*B*Cos[3*(c + d*x)] + 3*a^
4*b*C*Cos[3*(c + d*x)] - 6*a^2*b^3*C*Cos[3*(c + d*x)])*Sec[c + d*x]^2*Tan[c + d*x])/((a^2 - b^2)*(a + b*Cos[c
+ d*x])))/(12*a^5*d)

________________________________________________________________________________________

Maple [B]  time = 0.109, size = 1242, normalized size = 3.1 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^4/(a+b*cos(d*x+c))^2,x)

[Out]

1/2/d/a^2*B/(tan(1/2*d*x+1/2*c)+1)+1/2/d/a^2*B/(tan(1/2*d*x+1/2*c)-1)+1/2/d/a^2*B/(tan(1/2*d*x+1/2*c)-1)^2-1/2
/d/a^2*B/(tan(1/2*d*x+1/2*c)+1)^2-1/2/d/a^2*B*ln(tan(1/2*d*x+1/2*c)-1)+1/2/d/a^2*B*ln(tan(1/2*d*x+1/2*c)+1)-1/
3/d/a^2*A/(tan(1/2*d*x+1/2*c)+1)^3-1/d/a^2/(tan(1/2*d*x+1/2*c)+1)*C-1/3/d/a^2*A/(tan(1/2*d*x+1/2*c)-1)^3-1/d/a
^2/(tan(1/2*d*x+1/2*c)-1)*C-1/2/d/a^2*A/(tan(1/2*d*x+1/2*c)-1)^2+1/2/d/a^2*A/(tan(1/2*d*x+1/2*c)+1)^2-1/d/a^2*
A/(tan(1/2*d*x+1/2*c)-1)-1/d/a^2*A/(tan(1/2*d*x+1/2*c)+1)+2/d/a^3*b^4/(a^2-b^2)*tan(1/2*d*x+1/2*c)/(a*tan(1/2*
d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)*B-1/d*A*b/a^3*ln(tan(1/2*d*x+1/2*c)+1)+1/d*A*b/a^3*ln(tan(1/2*d*x+1/2
*c)-1)-8/d/a^5*b^6/(a+b)/(a-b)/((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2))*A+6/d/
a^4*b^5/(a+b)/(a-b)/((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2))*B+6/d/a*b^2/(a+b)
/(a-b)/((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2))*C-4/d/a^3*b^4/(a+b)/(a-b)/((a+
b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2))*C+10/d/a^3/(a+b)/(a-b)/((a+b)*(a-b))^(1/2
)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2))*A*b^4-8/d/a^2/(a+b)/(a-b)/((a+b)*(a-b))^(1/2)*arctan((a
-b)*tan(1/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2))*b^3*B-1/d/a^3/(tan(1/2*d*x+1/2*c)-1)*A*b-1/d/a^3/(tan(1/2*d*x+1/2*
c)+1)*A*b+1/d/a^3/(tan(1/2*d*x+1/2*c)+1)^2*A*b-4/d/a^5*ln(tan(1/2*d*x+1/2*c)+1)*A*b^3+3/d/a^4*ln(tan(1/2*d*x+1
/2*c)+1)*b^2*B-2/d/a^3*ln(tan(1/2*d*x+1/2*c)+1)*b*C-3/d/a^4/(tan(1/2*d*x+1/2*c)+1)*A*b^2+2/d/a^3/(tan(1/2*d*x+
1/2*c)+1)*b*B-1/d/a^3/(tan(1/2*d*x+1/2*c)-1)^2*A*b+4/d/a^5*ln(tan(1/2*d*x+1/2*c)-1)*A*b^3-3/d/a^4*ln(tan(1/2*d
*x+1/2*c)-1)*b^2*B+2/d/a^3*ln(tan(1/2*d*x+1/2*c)-1)*b*C-3/d/a^4/(tan(1/2*d*x+1/2*c)-1)*A*b^2+2/d/a^3/(tan(1/2*
d*x+1/2*c)-1)*b*B-2/d/a^2*b^3/(a^2-b^2)*tan(1/2*d*x+1/2*c)/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)
*C-2/d/a^4*b^5/(a^2-b^2)*tan(1/2*d*x+1/2*c)/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)*A

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^4/(a+b*cos(d*x+c))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^4/(a+b*cos(d*x+c))^2,x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**4/(a+b*cos(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.27219, size = 836, normalized size = 2.06 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^4/(a+b*cos(d*x+c))^2,x, algorithm="giac")

[Out]

-1/6*(12*(3*C*a^4*b^2 - 4*B*a^3*b^3 + 5*A*a^2*b^4 - 2*C*a^2*b^4 + 3*B*a*b^5 - 4*A*b^6)*(pi*floor(1/2*(d*x + c)
/pi + 1/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(a^2 - b^2)))/((a^7
 - a^5*b^2)*sqrt(a^2 - b^2)) + 12*(C*a^2*b^3*tan(1/2*d*x + 1/2*c) - B*a*b^4*tan(1/2*d*x + 1/2*c) + A*b^5*tan(1
/2*d*x + 1/2*c))/((a^6 - a^4*b^2)*(a*tan(1/2*d*x + 1/2*c)^2 - b*tan(1/2*d*x + 1/2*c)^2 + a + b)) - 3*(B*a^3 -
2*A*a^2*b - 4*C*a^2*b + 6*B*a*b^2 - 8*A*b^3)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a^5 + 3*(B*a^3 - 2*A*a^2*b - 4
*C*a^2*b + 6*B*a*b^2 - 8*A*b^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1))/a^5 + 2*(6*A*a^2*tan(1/2*d*x + 1/2*c)^5 - 3
*B*a^2*tan(1/2*d*x + 1/2*c)^5 + 6*C*a^2*tan(1/2*d*x + 1/2*c)^5 + 6*A*a*b*tan(1/2*d*x + 1/2*c)^5 - 12*B*a*b*tan
(1/2*d*x + 1/2*c)^5 + 18*A*b^2*tan(1/2*d*x + 1/2*c)^5 - 4*A*a^2*tan(1/2*d*x + 1/2*c)^3 - 12*C*a^2*tan(1/2*d*x
+ 1/2*c)^3 + 24*B*a*b*tan(1/2*d*x + 1/2*c)^3 - 36*A*b^2*tan(1/2*d*x + 1/2*c)^3 + 6*A*a^2*tan(1/2*d*x + 1/2*c)
+ 3*B*a^2*tan(1/2*d*x + 1/2*c) + 6*C*a^2*tan(1/2*d*x + 1/2*c) - 6*A*a*b*tan(1/2*d*x + 1/2*c) - 12*B*a*b*tan(1/
2*d*x + 1/2*c) + 18*A*b^2*tan(1/2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c)^2 - 1)^3*a^4))/d